package cn.rongdao.jrkabao.ui.cashcoupon.adapter;

import android.content.Context;
import android.view.ViewGroup;

import com.mifengkong.frtools.ui.adapter.recyclerview.FRBaseRecyclerAdapter;
import com.mifengkong.frtools.inputmethod.FRView;

import cn.rongdao.jrkabao.R;
import cn.rongdao.jrkabao.bean.cashcoupon.SelectCashCouponBean;

/**
 * Created by jack on 2017/8/15
 */

public class SelectCashCouponAdapter extends FRBaseRecyclerAdapter<SelectCashCouponBean.ListBean, SelectCashCouponViewHolder> {

    public SelectCashCouponAdapter(Context context, OnItemClickListener<SelectCashCouponViewHolder> listener) {
        super(context, listener);
    }

    @Override
    public SelectCashCouponViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new SelectCashCouponViewHolder(FRView.inflateLayout(getContext(), R.layout.item_select_cash_coupon, parent, false));
    }

    public void setAllUnSelected() {
        for (int i = 0; i < getDataList().size(); i++) {
            getDataList().get(i).setSelect(false);
        }
    }
}
